<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>

<script type="text/javascript">
    var ctx = '<%=request.getContextPath() %>';
</script>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>登录</title>
    <link rel="stylesheet"
          href="/framework/bootstrap/3.3.5/css/bootstrap.min.css"/>
    <style type="text/css">
        body {
            padding-top: 40px;
            padding-bottom: 40px;
            background-color: #eee;
        }

        .form-signin {
            max-width: 330px;
            padding: 15px;
            margin: 0 auto;
        }

        .form-signin .form-signin-heading,
        .form-signin .checkbox {
            margin-bottom: 10px;
        }

        .form-signin .checkbox {
            font-weight: normal;
        }

        .form-signin .form-control {
            position: relative;
            height: auto;
            -webkit-box-sizing: border-box;
            -moz-box-sizing: border-box;
            box-sizing: border-box;
            padding: 10px;
            font-size: 16px;
        }

        .form-signin .form-control:focus {
            z-index: 2;
        }

        .form-signin input[type="email"] {
            margin-bottom: -1px;
            border-bottom-right-radius: 0;
            border-bottom-left-radius: 0;
        }

        .form-signin input[type="password"] {
            margin-bottom: 10px;
            border-top-left-radius: 0;
            border-top-right-radius: 0;
        }

    </style>
</head>
<body style="background: #f3f3f4;">
<div class="container">
    <form class="form-signin" action="${ctx}/login"
          method="post">
        <h2 class="form-signin-heading">登录</h2>
        <label for="username" class="sr-only">用户名</label>
        <input type="text" id="username" name="username" class="form-control"
               placeholder="用户名" required autofocus>
        <label for="password" class="sr-only">密码</label>
        <input type="password" id="password" name="password"
               class="form-control"
               placeholder="密码" required>

        <c:if test="${jcaptchaEnabled}">
            验证码：
            <input class="form-control" name="jcaptchaCode"
                   type="text" required>
            <img class="form-control"
                 src="${ctx}/jcaptcha.jpg"
                 title="点击更换验证码"
                 onclick="this.src='${ctx}/jcaptcha.jpg?'+Math.random()">
        </c:if>

        <div class="checkbox">
            <label>
                <input type="checkbox" id="rememberMe"
                       name="rememberMe"> 记住我
            </label>
        </div>

        <button class="btn btn-lg btn-primary btn-block" type="submit"
                id="loginBtn">登录
        </button>

        <c:if test="${not empty error}">
            <div class="alert alert-danger alert-dismissible" role="alert"
                 id="loginDanger">
                <button type="button" class="close" data-dismiss="alert"
                        aria-label="Close"><span
                        aria-hidden="true">&times;</span>
                </button>
                <span>${error}</span>
            </div>
        </c:if>

    </form>
</div>

<script src="${pageContext.request.contextPath}/framework/jquery-easyui-1.4.4/jquery.min.js"></script>
<script src="${pageContext.request.contextPath}/framework/bootstrap/3.3.5/js/bootstrap.min.js"></script>
</body>
</html>